Skip to content

Conversation

estebank
Copy link
Contributor

No description provided.

@rust-highfive
Copy link
Contributor

r? @davidtwco

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Sep 25, 2021
@meithecatte
Copy link
Contributor

Suggested test case (no error should trigger):

use core::ops::Index;
struct X;
impl Index<i32> for X {
    type Output = ();
    
    fn index(&self, _: i32) -> &() {
        &()
    }
}

fn main() {
    X[-1];
}

@estebank estebank force-pushed the negative-index-literals branch from b50f3bb to c531106 Compare September 26, 2021 16:32
@estebank
Copy link
Contributor Author

@NieDzejkob added your case to the test.

@rust-log-analyzer

This comment has been minimized.

@estebank estebank force-pushed the negative-index-literals branch from c531106 to 8455a3b Compare September 26, 2021 16:51
@estebank estebank force-pushed the negative-index-literals branch from 8455a3b to 5c70f25 Compare September 26, 2021 16:52
Copy link
Member

@davidtwco davidtwco left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is looking really good, some minor changes. r=me after fixing.

@davidtwco davidtwco added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Sep 28, 2021
@estebank
Copy link
Contributor Author

@bors r=davidtwco

@bors
Copy link
Collaborator

bors commented Sep 28, 2021

📌 Commit e19d82f has been approved by davidtwco

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Sep 28, 2021
bors added a commit to rust-lang-ci/rust that referenced this pull request Oct 1, 2021
…arth

Rollup of 7 pull requests

Successful merges:

 - rust-lang#88838 (Do not suggest importing inaccessible items)
 - rust-lang#89251 (Detect when negative literal indices are used and suggest appropriate code)
 - rust-lang#89321 (Rebase resume argument projections during state transform)
 - rust-lang#89327 (Pick one possible lifetime in case there are multiple choices)
 - rust-lang#89344 (Cleanup lower_generics_mut and make span be the bound itself)
 - rust-lang#89397 (Update `llvm` submodule to fix function name mangling on x86 Windows)
 - rust-lang#89412 (Add regression test for issues rust-lang#88969 and rust-lang#89119 )

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit e77d163 into rust-lang:master Oct 1, 2021
@rustbot rustbot added this to the 1.57.0 milestone Oct 1, 2021
@estebank estebank deleted the negative-index-literals branch November 9, 2023 05:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants